﻿// 全局ajax控制，用于session超时 提示
layui.use('jquery',function(){
	layui.$.ajaxSetup({
		cache: false, //close AJAX cache
		//contentType:"application/x-www-form-urlencoded;charset=utf-8", 
		complete:function(XHR,textStatus){ 
			var sessionStatus = XHR.getResponseHeader("sessionstatus");
	    	if("timeout" == sessionStatus){ 
	    		sessionTimeOut();
	    	}
	    }
	});
});

function sessionTimeOut(){
	layer.msg('会话已过期，请重新登录~', {
        icon: 16
        ,shade: 0.01
        ,time :1200
      });
	setTimeout('window.top.location.href ="'+ basePath + '/login/exit.as"', 1200);
}


